<html>
<head><meta charset="utf-8"><title>rustc lint: inline code annotation? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20lint.3A.20inline.20code.20annotation.3F.html">rustc lint: inline code annotation?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="173006257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20lint%3A%20inline%20code%20annotation%3F/near/173006257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20lint.3A.20inline.20code.20annotation.3F.html#173006257">(Aug 12 2019 at 08:29)</a>:</h4>
<p>I am writing a rustc lint, and I want to add some text inline into the code I am showing -- similar to how suggestions are rendered, but this is not a suggestion, it is just text. What should I do?<br>
<code>span_note</code> doesn't do this, the text you give it shows up above the snippet is shows. <code>span_label</code> does something completely weird that I don't understand (it doesnt even respect the order in which it got called, showing up way in the beginning of the rendered diagnostic). And at that point I am out of options?</p>



<a name="173006349"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20lint%3A%20inline%20code%20annotation%3F/near/173006349" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20lint.3A.20inline.20code.20annotation.3F.html#173006349">(Aug 12 2019 at 08:31)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> do you want to do the minimal reordering now and postpone further tweaks until later?</p>



<a name="173006888"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20lint%3A%20inline%20code%20annotation%3F/near/173006888" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20lint.3A.20inline.20code.20annotation.3F.html#173006888">(Aug 12 2019 at 08:41)</a>:</h4>
<p>yeah. it seems just not possible to have a label on a secondary span (or whatever they are called)...</p>



<a name="173007699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/rustc%20lint%3A%20inline%20code%20annotation%3F/near/173007699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/rustc.20lint.3A.20inline.20code.20annotation.3F.html#173007699">(Aug 12 2019 at 08:55)</a>:</h4>
<p>also see <a href="https://github.com/rust-lang/rust/pull/63488" target="_blank" title="https://github.com/rust-lang/rust/pull/63488">https://github.com/rust-lang/rust/pull/63488</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>